<!DOCTYPE html>
<meta charset="UTF-8">
<style>
.target {
  color: white;
  width: 100px;
  height: 100px;
  background-color: black;
  display: inline-block;
  overflow: hidden;
}
.expected {
  background-color: green;
}
.target div {
  width: 10px;
  height: 10px;
  display: inline-block;
  background: orange;
  margin: 1px;
}
.test {
  overflow: hidden;
}
</style>
<body>
<template id="target-template">
<div></div>
</template>
<script src="resources/interpolation-test.js"></script>
<script>
assertInterpolation({
  property: '-webkit-transform',
  from: 'skewX(10rad) scaleZ(1)',
  to: 'skewX(20rad) scaleZ(2)'
}, [
  {at: -1, is: 'skewX(0rad) scaleZ(0)'},
  {at: 0, is: 'skewX(10rad) scaleZ(1)'},
  {at: 0.25, is: 'skewX(12.5rad) scaleZ(1.25)'},
  {at: 0.75, is: 'skewX(17.5rad) scaleZ(1.75)'},
  {at: 1, is: 'skewX(20rad) scaleZ(2)'},
  {at: 2, is: 'skewX(30rad) scaleZ(3)'},
]);
assertInterpolation({
  property: '-webkit-transform',
  from: 'skewX(10rad)',
  to: 'skewX(20rad) scaleZ(2)'
}, [
  {at: -1, is: 'skewX(0rad) scaleZ(0)'},
  {at: 0, is: 'skewX(10rad) scaleZ(1)'},
  {at: 0.25, is: 'skewX(12.5rad) scaleZ(1.25)'},
  {at: 0.75, is: 'skewX(17.5rad) scaleZ(1.75)'},
  {at: 1, is: 'skewX(20rad) scaleZ(2)'},
  {at: 2, is: 'skewX(30rad) scaleZ(3)'},
]);
assertInterpolation({
  property: '-webkit-transform',
  from: 'scaleZ(3) perspective(400px)',
  to: 'scaleZ(4) skewX(1rad) perspective(500px)'
}, [
  {at: -1, is: 'scaleZ(2) matrix3d(1, 0, 0, 0, -1.55741, 1, 0, 0, 0, 0, 1, -0.003, 0, 0, 0, 1)'},
  {at: 0, is: 'scaleZ(3) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)'},
  {at: 0.25, is: 'scaleZ(3.25) matrix3d(1, 0, 0, 0, 0.389352, 1, 0, 0, 0, 0, 1, -0.002375, 0, 0, 0, 1)'},
  {at: 0.75, is: 'scaleZ(3.75) matrix3d(1, 0, 0, 0, 1.16806, 1, 0, 0, 0, 0, 1, -0.002125, 0, 0, 0, 1)'},
  {at: 1, is: 'scaleZ(4) matrix3d(1, 0, 0, 0, 1.55741, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)'},
  {at: 2, is: 'scaleZ(5) matrix3d(1, 0, 0, 0, 3.11482, 1, 0, 0, 0, 0, 1, -0.0015, 0, 0, 0, 1)'},
]);
assertInterpolation({
  property: '-webkit-transform',
  from: 'translateY(70%) scaleZ(1)',
  to: 'translateY(90%) scaleZ(2)'
}, [
  {at: -1, is: 'translateY(50%) scaleZ(0)'},
  {at: 0, is: 'translateY(70%) scaleZ(1)'},
  {at: 0.25, is: 'translateY(75%) scaleZ(1.25)'},
  {at: 0.75, is: 'translateY(85%) scaleZ(1.75)'},
  {at: 1, is: 'translateY(90%) scaleZ(2)'},
  {at: 2, is: 'translateY(110%) scaleZ(3)'},
]);
assertInterpolation({
  property: '-webkit-transform',
  from: 'translateY(70%)',
  to: 'translateY(90%) scaleZ(2)'
}, [
  {at: -1, is: 'translateY(50%) scaleZ(0)'},
  {at: 0, is: 'translateY(70%)'},
  {at: 0.25, is: 'translateY(75%) scaleZ(1.25)'},
  {at: 0.75, is: 'translateY(85%) scaleZ(1.75)'},
  {at: 1, is: 'translateY(90%) scaleZ(2)'},
  {at: 2, is: 'translateY(110%) scaleZ(3)'},
]);

// Skew
assertInterpolation({
  property: '-webkit-transform',
  from: 'skewX(10rad)',
  to: 'skewX(20rad)'
}, [
  {at: -1, is: 'skewX(0rad)'},
  {at: 0, is: 'skewX(10rad)'},
  {at: 0.25, is: 'skewX(12.5rad)'},
  {at: 0.75, is: 'skewX(17.5rad)'},
  {at: 1, is: 'skewX(20rad)'},
  {at: 2, is: 'skewX(30rad)'},
]);
assertInterpolation({
  property: '-webkit-transform',
  from: 'skewY(10rad)',
  to: 'skewY(20rad)'
}, [
  {at: -1, is: 'skewY(0rad)'},
  {at: 0, is: 'skewY(10rad)'},
  {at: 0.25, is: 'skewY(12.5rad)'},
  {at: 0.75, is: 'skewY(17.5rad)'},
  {at: 1, is: 'skewY(20rad)'},
  {at: 2, is: 'skewY(30rad)'},
]);
</script>
</body>
